//
//  ViewController.m
//  多次present控制器
//
//  Created by chenleping on 2018/7/11.
//  Copyright © 2018年 IAPTest. All rights reserved.
//

#import "ViewController.h"

#import "SecondViewController.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    self.view.backgroundColor = [UIColor yellowColor];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    SecondViewController * secondVC = [[SecondViewController alloc] init];
    
//    [self.navigationController pushViewController:secondVC animated:YES];
    
    UINavigationController * nav = [[UINavigationController alloc] initWithRootViewController:secondVC];
    [self presentViewController:nav animated:YES completion:nil];
    
//    [self presentViewController:secondVC animated:YES completion:nil];
    
}

@end
